<!DOCTYPE html>
<html lang="en" class="no-js" xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
	layout:decorator="admin/layout">
<head>
<title>商户管理</title>
<script th:inline="javascript">
	/*<![CDATA[*/
	           
	 $(document).ready(function(){

		 $("#businessManForm").validate({
	         rules:{
	        	 name:{
	            	 required:true,
	            	 maxlength:10
	             },phone:{
	            	 required:true
	             },store_url:{
	            	 required:true
	             },user_id:{
	            	 required:true
	             },goods_discount:{
	            	 required:true,
	            	 range:[0,10]
	             }
	             
	             
	             
	              
	         },
	         messages:{
	             name:{
	                 required:"请输入商户名称"
	             },phone:{
	                 required:"请输入手机号"
	             },store_url:{
	                 required:"请输网店地址"
	             },user_id:{
	                 required:"请输入绑定用户ID"
	             },goods_discount:{
	            	 required:"请输入进货折扣"
	             }
	             
	         }
	         
	      });
		 
	  });
	
			/*]]>*/
</script>
</head>
<body>
	<div layout:fragment="content">
		<div class="row">
			<div class="col-md-12">
				<div class="btn-group pull-right">
					<a href="index.html" th:href="@{/admin/money/businessMan/index/}" id="sample_editable_1_new" class="btn green">返回<i class="fa fa-arrow-circle-o-left"></i></a>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-md-12">
				<div class="form">
					<form role="form" th:action="@{/admin/money/businessMan/save}" th:object="${businessMan}"
						id="businessManForm" method="post" class="form-horizontal">
						<h4 class="form-section">会员信息</h4>
						<input type="hidden" th:field="*{id}" />
						<div class="form-body">
							<div class="form-group"
								th:class="${#fields.hasErrors('name')}? 'form-group has-error' : 'form-group'">
								<label class="control-label col-md-3">商户名称:<span
									class="required" aria-required="true">* </span></label>
								<div class="col-md-4">
									<input type="text" class="form-control" placeholder="商户名称" th:field="*{name}" />
								</div>
							</div>
							<div class="form-group"
								th:class="${#fields.hasErrors('QQ')}? 'form-group has-error' : 'form-group'">
								<label class="control-label col-md-3">联系QQ:<span
									class="required" aria-required="true"> </span></label>
								<div class="col-md-4">
									<input type="text" class="form-control" placeholder="联系QQ" th:field="*{QQ}" />
								</div>
							</div>
							<div class="form-group"
								th:class="${#fields.hasErrors('phone')}? 'form-group has-error' : 'form-group'">
								<label class="control-label col-md-3">联系电话:<span
									class="required" aria-required="true">* </span></label>
								<div class="col-md-4">
									<input type="text" class="form-control" placeholder="联系电话" th:field="*{phone}" />
								</div>
							</div>
							<div class="form-group"
								th:class="${#fields.hasErrors('store_url')}? 'form-group has-error' : 'form-group'">
								<label class="control-label col-md-3">网店地址:<span
									class="required" aria-required="true">* </span></label>
								<div class="col-md-4">
									<input type="text" class="form-control" placeholder="网店地址" th:field="*{store_url}" />
								</div>
							</div>
							<div class="form-group"
								th:class="${#fields.hasErrors('user_id')}? 'form-group has-error' : 'form-group'">
								<label class="control-label col-md-3">绑定用户ID:<span
									class="required" aria-required="true">* </span></label>
								<div class="col-md-4">
									<input type="text" class="form-control" placeholder="绑定用户ID" th:field="*{user_id}" />
								</div>
							</div>
							<div class="form-group"
								th:class="${#fields.hasErrors('goods_discount')}? 'form-group has-error' : 'form-group'">
								<label class="control-label col-md-3">进货折扣:<span
									class="required" aria-required="true">* </span></label>
								<div class="col-md-4">
									<input type="text" class="form-control" placeholder="进货折扣" th:field="*{goods_discount}" />
								</div>
							</div>

							<div class="form-group">
								<label class="control-label col-md-3">推荐商户:</label>
								<div class="col-md-4">
									<div class="radio-list">
										<label class="radio-inline"> <span> <input
												id="radio_displayed_1" type="radio" value="1" checked=""
												th:field="*{recommend}" />
										</span>是
										</label> <label class="radio-inline"><span><input
												id="radio_displayed_2" type="radio" value="0"
												th:field="*{recommend}" /></span> 否</label>
									</div>
								</div>
							</div>
							
							<div class="form-group">
								<label class="control-label col-md-3">自动发卡:</label>
								<div class="col-md-4">
									<div class="radio-list">
										<label class="radio-inline"> <span> <input
												id="radio_displayed_1" type="radio" value="1" checked=""
												th:field="*{automatic_card}" />
										</span>是
										</label> <label class="radio-inline"><span><input
												id="radio_displayed_2" type="radio" value="0"
												th:field="*{automatic_card}" /></span> 否</label>
									</div>
								</div>
							</div>
						<div class="form-group"
								th:class="${#fields.hasErrors('content')}? 'form-group has-error' : 'form-group'">
								<label class="control-label col-md-3">商户备注:<span
									class="required" aria-required="true"></span></label>
								<div class="col-md-4">
									<input type="text" class="form-control" placeholder="商户备注" th:field="*{content}" />
								</div>
							</div>

						</div>
						<div class="form-actions fluid">
							<div class="col-md-offset-3 col-md-9">
								<button type="submit" class="btn blue" name="sub">提交</button>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
</body>
</html>